const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
});
module.exports = {

  configureWebpack: {
    plugins:[
    ]
  },
  chainWebpack: (config) => {
    config.optimization.minimizer('terser').tap((args) => {
      args[0].parallel = 4
      args[0].terserOptions.compress.warnings = true
      args[0].terserOptions.compress.dead_code = true
      args[0].terserOptions.compress.unused = true
      args[0].terserOptions.compress.drop_debugger = true
      args[0].terserOptions.compress.drop_console = true
      return args
    })
    config.plugin("define").tap((args) => {
      args[0] = {
        ...args[0],
        BRANCH: JSON.stringify(process.env.VUE_APP_BRANCH),
        SHENZHEN: JSON.stringify(process.env.VUE_APP_SHENZHEN),
      };
      return args;
    });
    config.plugin('html')
    .tap(args => {
      args[0].title = process.env.VUE_APP_BRANCH;
      return args;
    })    
  },
};
